package mbti

import (
	"MBTI-backend/models"
	"MBTI-backend/pkg/app"
	"MBTI-backend/pkg/constant"
	"github.com/gin-gonic/gin"
)

func StoreTestAnswer(c *gin.Context) {
	err, info, result:= models.StoreTestAnswer(c)
	if err !=nil {
		app.Fail(c,constant.ERROR,err,err.Error())
		return
	}
	app.Success(c, map[string]interface{}{"value": info, "result": result}, "Success")
}

func GetTestResult(c *gin.Context) {
	testResultParam := map[string]interface{}{
    	"searchSno": c.Query("Sno"),
    }
	err, info := models.GetTestResult(testResultParam)
	if err != nil {
		app.Fail(c, constant.ERROR, err, err.Error())
		return
	}
	app.Success(c, map[string]interface{}{"value": info}, "Success")
}
